package com.music.service.urls.constants;



public enum UrlAccessState {
	ACCESSIBLE(1), NOT_ACCESSIBLE(2);

	private int mState;

	UrlAccessState(int pState) {
		mState = pState;
	}

	public int getState() {
		return mState;
	}

	public static UrlAccessState getState(int pState) {
		switch (pState) {
		case 1:
			return ACCESSIBLE;
		case 2:
			return NOT_ACCESSIBLE;
		default:
			return null;
		}
	}
	public static UrlAccessState getUrlAccessState(String pState){
		if (pState != null && pState.length() > 0) {
			char state = pState.charAt(0);
			switch (state) {
			case 'V':
				return ACCESSIBLE;
			case 'N':
				return NOT_ACCESSIBLE;
			}
		}
		return null;
	}
	
}
